/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package TestKelas;

import MenuUtamaSistem.Login;
import MenuUtamaSistem.MainMenuForm;
import MenuUtamaSistem.MenuUtamaController;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author asus
 */
public class LoginTest {

    public static void main(String[] args) {
        System.out.println("Test 1 : login");
        Login log1 = new Login();
        log1.setUser("PP_100");
        log1.setPass("pp_100");
        System.out.println("user :"+log1.getUser());
        System.out.println("pass :"+log1.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log1.getUser()).getPass().equals(log1.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Test 2 : login");
        Login log2 = new Login();
        log2.setUser(" ");
        log2.setPass("pp_100");
        System.out.println("User :"+log2.getUser());
        System.out.println("pass :"+log2.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log2.getUser()).getPass().equals(log2.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Test 3 : login");
        Login log3 = new Login();
        log3.setUser("PP_100");
        log3.setPass("asasa");
        System.out.println("user :"+log3.getUser());
        System.out.println("pass :"+log3.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log3.getUser()).getPass().equals(log3.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 4 : login");
        Login log4 = new Login();
        log4.setUser("PP_101");
        log4.setPass("pp_101");
        System.out.println("user :"+log4.getUser());
        System.out.println("pass :"+log4.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log4.getUser()).getPass().equals(log4.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 5 : login");
        Login log5 = new Login();
        log5.setUser("");
        log5.setPass("pp_101");
        System.out.println("user :"+log5.getUser());
        System.out.println("pass :"+log5.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log5.getUser()).getPass().equals(log5.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 6 : login");
        Login log6 = new Login();
        log6.setUser("PP_101");
        log6.setPass("dddfs");
        System.out.println("user :"+log5.getUser());
        System.out.println("pass :"+log5.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log5.getUser()).getPass().equals(log5.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 7 : login");
        Login log7 = new Login();
        log7.setUser("AD_100");
        log7.setPass("ad_100");
        System.out.println("user :"+log7.getUser());
        System.out.println("pass :"+log7.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log7.getUser()).getPass().equals(log7.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 8 : login");
        Login log8 = new Login();
        log8.setUser("eer");
        log8.setPass("ad_100");
        System.out.println("user :"+log8.getUser());
        System.out.println("pass :"+log8.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log8.getUser()).getPass().equals(log8.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Test 9 : login");
        Login log9 = new Login();
        log9.setUser("AD_100");
        log9.setPass("AD_100");
        System.out.println("user :"+log9.getUser());
        System.out.println("pass :"+log9.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log9.getUser()).getPass().equals(log9.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Test 10 : login");
        Login log10 = new Login();
        log10.setUser("AD_101");
        log10.setPass("ad_101");
        System.out.println("user :"+log10.getUser());
        System.out.println("pass :"+log10.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log10.getUser()).getPass().equals(log10.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        System.out.println("Test 11 : login");
        Login log11 = new Login();
        log11.setUser("234");
        log11.setPass("ad_101");
        System.out.println("user :"+log11.getUser());
        System.out.println("pass :"+log11.getPass());
        try {
            if (MenuUtamaController.getKoneksiKontrol().cekUser(log11.getUser()).getPass().equals(log11.getPass())) {
                System.out.println("Berhasil");
            } else {
                System.out.println("Gagal");
            }

        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(LoginTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
